package com.lantosec.hmrp.modules.internal.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.internal.vo.InternalTaskExecutorVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 评价任务评价人 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-06-19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class InternalTaskExecutor extends BaseEntity<InternalTaskExecutorVO> {

    private static final long serialVersionUID = 1L;
    public InternalTaskExecutor(InternalTaskExecutorVO vo){
        this.internalTaskExecutorId = vo.getInternalTaskExecutorId();
        this.internalTaskId = vo.getInternalTaskId();
        this.executorMode = vo.getExecutorMode();
        this.executorDeptId = vo.getExecutorDeptId();
        this.executorPositionId = vo.getExecutorPositionId();
        this.executorUserId = vo.getExecutorUserId();
        this.targetTotalnum = vo.getTargetTotalnum();
        this.targetFinishednum = vo.getTargetFinishednum();
    }

    @Override
    public InternalTaskExecutorVO convertToVO(){
        return new InternalTaskExecutorVO(this);
    }


    /**
     * 主键ID
     */
    @TableId(value = "internal_task_executor_id", type = IdType.AUTO)
    private Integer internalTaskExecutorId;

    /**
     * 评价任务ID
     */
    private Integer internalTaskId;

    /**
     * 评价方形式
     */
    private Integer executorMode;

    /**
     * 评价方ID（部门）
     */
    private String executorDeptId;

    /**
     * 评价方ID（岗位）
     */
    private String executorPositionId;

    /**
     * 评价人ID
     */
    private String executorUserId;

    /**
     * 被评价对象总数
     */
    private Integer targetTotalnum;

    /**
     * 已评价的被评价对象数
     */
    private Integer targetFinishednum;


    public enum ColName {
        internal_task_executor_id, internal_task_id, executor_mode, executor_dept_id, executor_position_id, executor_user_id, target_totalnum, target_finishednum,
    }
}
